﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Register Src="~/Views/Shared/Checkbox.ascx" TagName="checkbox" TagPrefix="uc" %>

<%
    int lang = (int)ViewData["Language"];
    VietImage.Models.Image img = (VietImage.Models.Image)ViewData["Image"];
    if (img != null)
    {
%>
<div imgid="<%= img.ID %>" class="imagelistitem">
    <div class="imagelistitem_image">
        <img alt="<%= img.GetDetail(lang).Name%>"  onclick="viewimage(<%= img.ID %>);" src="/Image/Display/<%= img.ID %>" />
    </div>
    <div class="imagelistitem_title">
<%
        if (ViewData["Parent"] is VietImage.Models.Lightbox)
        {
            chk1.ID = "chkimg" + img.ID;
            chk1.Style = "margin-bottom: 4px;";
%>
        <uc:checkbox ID="chk1" Class="chkimg" runat="server" />
        <div class="imagelistitem_name"><label for="<%= chk1.ID %>"><%= img.GetDetail(lang).Name%></label></div>
        <div class="clear"></div>
        <div class="imagelistitem_download"><span><a><img src="/Content/Images/download.png" />Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
<%
        }
        else
        {
            if (Session["role"] is VietImage.Roles.CustomerRole)
            {
%>
        <div class="imagelistitem_addlightbox"><img src="/Content/Images/plus.png" /></div>
<%
            }
%>
        <div class="imagelistitem_name"><%= img.GetDetail(lang).Name%></div>
        <div class="clear"></div>
        <div class="imagelistitem_download"><span><a><img src="/Content/Images/download.png" />Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
<%
        }
%>
    </div>
</div>
<%
    }
 %>
